package com.ecommerce.dal.entity;
// Generated May 3, 2013 3:35:49 PM by Hibernate Tools 3.6.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Communication generated by hbm2java
 */
@Entity
@Table(name = "communication", uniqueConstraints = @UniqueConstraint(columnNames = "COMMUNICATION_TYPE"))
public class Communication implements java.io.Serializable {

	private Integer communicationId;
	private String communicationType;
	private Set<UserCommunication> userCommunications = new HashSet<UserCommunication>(
			0);
	private Set<CompanyCommunication> companyCommunications = new HashSet<CompanyCommunication>(
			0);

	public Communication() {
	}

	public Communication(String communicationType) {
		this.communicationType = communicationType;
	}

	public Communication(String communicationType,
			Set<UserCommunication> userCommunications,
			Set<CompanyCommunication> companyCommunications) {
		this.communicationType = communicationType;
		this.userCommunications = userCommunications;
		this.companyCommunications = companyCommunications;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "COMMUNICATION_ID", unique = true, nullable = false)
	public Integer getCommunicationId() {
		return this.communicationId;
	}

	public void setCommunicationId(Integer communicationId) {
		this.communicationId = communicationId;
	}

	@Column(name = "COMMUNICATION_TYPE", unique = true, nullable = false)
	public String getCommunicationType() {
		return this.communicationType;
	}

	public void setCommunicationType(String communicationType) {
		this.communicationType = communicationType;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "communication")
	public Set<UserCommunication> getUserCommunications() {
		return this.userCommunications;
	}

	public void setUserCommunications(Set<UserCommunication> userCommunications) {
		this.userCommunications = userCommunications;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "communication")
	public Set<CompanyCommunication> getCompanyCommunications() {
		return this.companyCommunications;
	}

	public void setCompanyCommunications(
			Set<CompanyCommunication> companyCommunications) {
		this.companyCommunications = companyCommunications;
	}

}
